package cn.itcast.java;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * Author itcast
 * Date 2021/10/9 22:35
 * Desc TODO
 */
public class ExceptionDemo {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(Calendar.getInstance().getTime());
        System.out.println(format);
        try {
            int i = 1 / 0;
        }catch (Exception ex){
            System.out.println(ex.getCause());
            System.out.println(ex.getStackTrace());
            System.out.println(ex.getMessage());
            System.out.println(ex.getLocalizedMessage());
            System.out.println(ex.fillInStackTrace());
            ex.printStackTrace();
        }

    }
}
